package com.tz.filpboard.application;

import com.avos.avoscloud.AVAnalytics;
import com.avos.avoscloud.AVOSCloud;
import com.baidu.frontia.Frontia;
import com.baidu.frontia.FrontiaApplication;
import com.baidu.frontia.api.FrontiaStatistics;
import com.baidu.mobstat.SendStrategyEnum;

public class App extends FrontiaApplication {

	public static final String BAIDU_REPORTID = "49c9c0f125";

	@Override
	public void onCreate() {
		super.onCreate();
		AVOSCloud.initialize(this, "8kzXuknXJdjKFjFAsYa5kpM8",
				"4B1V40XI9GyWqcLeCNN9VHFs");
		AVAnalytics.enableCrashReport(this, true);
		// 初始化应用统计
		initFrontia();
	}

	private void initFrontia() {
		if (Frontia.init(getApplicationContext(), BAIDU_REPORTID)) {
			FrontiaStatistics stat = Frontia.getStatistics();
			stat.setReportId(BAIDU_REPORTID);
			stat.setSessionTimeout(20);
			stat.enableExceptionLog();
			stat.start(SendStrategyEnum.SET_TIME_INTERVAL, 0, 10, false);
		}
	}
}
